/*
 * $Id: ResourceGroup.java 1599 2011-08-21 10:44:52Z jyang $
 * 
 * Copyright (c) 2001-2008 Accentrix Company Limited. All Rights Reserved.
 * 
 * Accentrix Company Limited. ("Accentrix") retains copyright on all text, source
 * and binary code contained in this software and documentation. Accentrix grants
 * Licensee a limited license to use this software, provided that this copyright
 * notice and license appear on all copies of the software. The software source
 * code is provided for reference purposes only and may not be copied, modified 
 * or distributed.
 * 
 * THIS SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS," WITHOUT ANY WARRANTY OF
 * ANY KIND UNLESS A SEPARATE WARRANTIES IS PURCHASED FROM ACCENTRIX AND REMAINS
 * VALID.  ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
 * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 * PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. ACCENTRIX SHALL NOT BE LIABLE
 * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING OR MODIFYING THE
 * SOFTWARE OR ITS DERIVATIVES.
 * 
 * IN NO EVENT WILL ACCENTRIX BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
 * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES,
 * HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE
 * USE OF OR INABILITY TO USE SOFTWARE, EVEN IF ACCENTRIX HAS BEEN ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES.
 */
package com.lightsaber.trade.cloth.entity.planning;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.lightsaber.trade.core.entity.BaseEntity;

@Entity
@Table(name = "MHPP_RESOURCE_GROUP")
public class ResourceGroup extends BaseEntity {

    private static final long serialVersionUID = 6838254774811160977L;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "LEVEL_3_PLANNING_ID", updatable = false)
    private Level3Planning level3Planning;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PROGRAMME_PLANNING_ITEM_ID", updatable = false)
    private ProgrammePlanningItem programmePlanningItem;

    @Column(name = "NAME", nullable = false, length = 200)
    private String name;

    @Column(name = "PLACE", nullable = false)
    private Integer place;

    @OneToMany(mappedBy = "resourceGroup", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<ResourceGroupItem> resourceGroupItems;

    public Level3Planning getLevel3Planning() {
        return level3Planning;
    }

    public void setLevel3Planning(final Level3Planning level3Planning) {
        this.level3Planning = level3Planning;
    }

    public ProgrammePlanningItem getProgrammePlanningItem() {
        return programmePlanningItem;
    }

    public void setProgrammePlanningItem(final ProgrammePlanningItem programmePlanningItem) {
        this.programmePlanningItem = programmePlanningItem;
    }

    public String getName() {
        return name;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public Integer getPlace() {
        return place;
    }

    public void setPlace(final Integer place) {
        this.place = place;
    }

    public List<ResourceGroupItem> getResourceGroupItems() {
        return resourceGroupItems;
    }

    public void setResourceGroupItems(final List<ResourceGroupItem> resourceGroupItems) {
        this.resourceGroupItems = resourceGroupItems;
    }
}
